<!--{include manage_header}-->

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="coupons">
	<div class="dashboard" id="dashboard">
		<ul>${mcurrent_page_ad($selector)}</ul>
	</div>
    <div id="content" class="coupons-box clear mainwide">
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head">
				<!--{if $selector=='page_ad_failure'}-->
                    <h2>已下线广告</h2>
				<!--{else}-->
                    <h2>当前广告</h2>
				<!--{/if}-->
					<ul class="filter">
						<li><form method="get">
						位置：<select name="position">
							<option value="">全部位置</option>
							<!--${
								$position = require_once(dirname(dirname(dirname(__FILE__))).'/include/configure/ad_position.php');
								foreach($position as $key=>$val){
									if($_GET['position'] == $key){
										echo "<option selected value=\"$key\">$val</option>";
									}else{
										echo "<option value=\"$key\">$val</option>";
									}
								}
							}-->
						</select>
						城市：<select name="city_id" style="width:100px;">${Utility::Option(Utility::OptionArray($allcities, 'id','name'), $_GET['city_id'], '全部城市')}</select>&nbsp;<input type="submit" value="筛选" class="formbutton"  style="padding:1px 6px;"/><form></li>
					</ul>
				</div>
                <div class="sect" style="padding-top:0">
					<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
					<tr><th width="40">ID</th><th width="400">广告图片</th><th width="80" nowrap>城市</th><th width="100">日期</th><th width="50">位置</th><th width="140">状态</th><th width="140">操作</th></tr>
					<!--{loop $ads $index $one}-->
					<tr ${$index%2?'':'class="alt"'} id="team-list-id-{$one['id']}">
						<td>{$one['id']}</td>
						<td><a class="deal-title" href="{$one['url']}" target="_blank"><img src="/static/{$one['image']}" title="{$one['title']}" width="350" /></a></td>
						<td nowrap><!--{if $cities[$one['city_id']]['name']}-->{$cities[$one['city_id']]['name']}<!--{else}-->全部城市<!--{/if}--></td>
						<td nowrap>${date('Y-m-d',$one['begin_time'])}<br/>${date('Y-m-d',$one['end_time'])}</td>
						<td nowrap><!--${
							$position = require(dirname(dirname(dirname(__FILE__))).'/include/configure/ad_position.php');
							$key = $one['position'];
							echo $position[$key];
						}--></td>
						<td><!--{if $one['end_time'] > $now && $one['begin_time'] < $now}--><label style="color:green">在线</label><!--{elseif $one['end_time'] > $now && $one['begin_time'] > $now}--><label style="color:blue">即将上线</label><!--{else}--><label style="color:red">已下线</label><!--{/if}--></td>
						<td class="op" nowrap><a href="/manage/ad/edit.php?id={$one['id']}">编辑</a>｜<a href="/ajax/manage.php?action=page_ad_remove&id={$one['id']}" class="ajaxlink" ask="确定删除本广告吗？" >删除</a></td>
					</tr>
					<!--{/loop}-->
					<tr><td colspan="7">{$pagestring}</tr>
                    </table>
				</div>
            </div>
            <div class="box-bottom"></div>
        </div>
    </div>
</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->

<!--{include manage_footer}-->
